package com.cdte.util;

import cn.hutool.core.text.CharSequenceUtil;

import java.io.File;
import java.io.IOException;

/**
 * @author zhoubin
 * @date 2022/10/31 19:47
 */
public class FileUtil {

    /**
     * 创建文件
     * @param filePath
     * @return
     */
    public static File createExcel(String filePath) {

        if (CharSequenceUtil.isBlank(filePath) || (!filePath.endsWith(".xlsx") && !filePath.endsWith(".xls"))) {
            throw new IllegalArgumentException("只能生成Excel文档");
        }

        return new File(filePath);
    }
}
